The present invention relates to a load balancing apparatus which balances the load of servers in a client/server system. More particularly, this invention relates to the load balancing system which prevents service from stopping in the event of a disaster.
Recently, a load balancing technique f or preventing load concentration in a single server is used in large-scale networks of which the internet is a representative example. According to this technique, multiple servers are provided on a server side which receives a great number of accesses, and the multiple servers function as one server for a client.
This load balancing technique reduces the load on one server by balancing the access from the client among multiple servers. Therefore, in the load balancing technique, accesses are received from the client and are sorted as far as is possible to one of the multiple servers which has a low load and is located near the client. This is important in increasing the efficiency of the network.
FIG. 18 shows one example of a constitution of a conventional network system. In the network system shown in FIG. 18, a round robin method is used as a load balancing method in a DNS (Domain Name System) server. This round robin method handles an access by using domain names explained later, and balances the load by using IP addresses of multiple servers in sequence when converting the domain names to IP (Internet Protocol) addresses.
In FIG. 18, an LAN (Local Area Network)/WAN (Wide Area Network) 1 and an LAN/WAN 4 comprise large-scale networks for carrying out data communication between multiple computers, which are physically separated, by means of internet working. For example, the LAN/WAN 1 and 4 comprise an internet.
A network which satisfies the following conditions is appropriate as the above-mentioned internet.
(1) The computer network has a communications protocol (communications connection sequence) termed a TCP/IP (Transmission Control Protocol/Internet Protocol) mounted therein.
(2) The computer network is connected to one worldwide network configured around several basic networks.
Each protocol TCP and UDP (User Datagram Protocol) in the fourth layer (transport layer) of an OSI (Open System Interconnection) reference model is defined to create the TCP/IP. A characteristic of the TCP is to send reliable data communications (transmissions). That is, regular data communication is ensured by maintaining the reliability of the communications path from the start of the communication to the end of the communication, and by detecting and correcting errors.
The above-mentioned TCP has a connection-type server format for maintaining reliability. In contrast, the UDP is a data transmission protocol termed a connectionless-type for increasing the processing speed, and does not perform response confirmation or sequential adjustments of data received along different communications paths in the network in order to increase reliability.
The client 2 is provided on the client (user) side, and is connected to the LAN/WAN 1. The client 2 comprises a computer end terminal for requesting service from a server 6 (and a server 7) explained later via the LAN/WAN 1 and the LAN/WAN 4. A client-side DNS server 3 realizes internet standard DNS and connects to the LAN/WAN 1.
The DNS will be explained in detail. In the internet, IP addresses are used to identify the end terminals as described above. However, since an IP address comprises a combination of numbers expressed in four octets (32 bits), it is extremely difficult for a person to memorize. Accordingly, domain names (name space) which can be easily memorized by a person are appended to each end terminal as identifiers.
The DNS is a system for managing the relationship between the domain names and the IP addresses, and supplying an IP address in response to an inquiry from the client 2 relating to a domain name. The client-side DNS server 3 is an apparatus for realizing the above-mentioned DNS, and is positioned as a local DNS server for the client 2.
The server 6 is provided on the service supplier side and connects to the LAN/WAN 4. The server 6 comprises a computer terminal for supplying service to the client 2 in accordance with a service request therefrom. The server 7 is similarly provided on the service supplier side as the server 6 and connects to the LAN/WAN 4. The server 7 comprises a computer terminal for supplying service to the client 2 in accordance with a service request therefrom. The server 6 and the server 7 are provided in physically different places. Therefore, the distances between the servers 6 and 7 and the client 2 (the client-side DNS server 3) are different.
From the point of view of the client 2, the servers 6 and 7 function as a single server. A single domain name (hereinafter termed representative domain name) is appended representatively to the servers 6 and 7. In addition, IP addresses are appended to the servers 6 and 7. That is, multiple IP addresses are registered to one domain name in this case, so that the client 2 can access either one of the servers 6 and 7 by accessing one domain name.
That is, the servers 6 and 7 form one virtual server which is expressed by the representative domain name, and the client 2 accesses the representative domain name of this virtual server. One representative domain name is appended to the servers 6 and 7, and the client 2 can access either one of the servers 6 and 7, in order to balance the load as described above. This load balancing will be explained later.
A server-side DNS server 5 functions as a DNS server in the same way as the client-side DNS server 3, and is provided as a higher-level apparatus of the client-side DNS server 3. That is, the server-side DNS server 5 responds to inquiries relating to IP addresses from the client-side DNS server 3.
The server-side DNS server 5 is responsible for the servers 6 and 7, and when an inquiry to convert a representative domain name to an IP address is received from the client-side DNS server 3, the server-side DNS server 5 responds to the client-side DNS server 3 by converting the representative domain name to the IP address of either one of the servers 6 and 7. That is, the server-side DNS server 5 sorts the access request from the client 2 by allocating it to either one of the servers 6 and 7. This sorting constitutes the load balancing mentioned above.
In the above-described constitution, when accessing the virtual server of the representative domain name, for example in a step SA1 the client 2 sends notification via the LAN/WAN 1 to the client-side DNS server 3 of the representative domain name corresponding to the IP address for which an inquiry has been received from the client-side DNS server 3.
The client-side DNS server 3 determines whether the same inquiry has previously been received by accessing its own cash memory (not shown in FIG. 18) and consulting inquiry history data. When the same inquiry has previously been received, in a step SA4 the client-side DNS server 3 notifies the client 2 via the LAN/WAN 1 of the IP address contained in the inquiry history data. The inquiry history data is held in the cash memory for approximately one day.
On the other hand, when the same inquiry has not previously been received, in a step SA2 the client-side DNS server 3 sends an inquiry for DNS to the server-side DNS server 5 via the LAN/WAN 1 and the LAN/WAN 4. Specifically, the client-side DNS server 3 notifies the server-side DNS server 5 of the representative domain name. Consequently, in a step SA3 the server-side DNS server 5 consults a sorting table (not shown in the diagram) in which the server 6 is deemed a first server and the server 7 is deemed a second server, and converts the representative domain name for which notification has been received to, for example, the IP address of the first server 6.
The server-side DNS server 5 transmits the IP address of the server 6 to the client-side DNS server 3 via the LAN/WAN 4 and the LAN/WAN 1. Then, in the step SA4 the client-side DNS server 3 stores the IP address of the server 6 as the above-mentioned inquiry history data in its cash memory (not shown in FIG. 18) and notifies the client 2 via the LAN/WAN 1.
In a step SA5, the client 2 transmits an IP packet including the IP address of the server 6 via the LAN/WAN 1 and the LAN/WAN 4 to the server 6. The IP packet reaches the server 6 after being routed by a router (not shown in FIG. 18). As a result, a connection is established between the client 2 and the server 6, and the server 6 supplies the service requested by the client 2.
When another client which is not shown in FIG. 18 notifies the client-side DNS server 3 of the representative domain name via the LAN/WAN 1 (Step SA1), in the step SA2 the client-side DNS server 3 sends an inquiry for the IP address via the LAN/WAN 1 and the LAN/WAN 4 to the server-side DNS server 5 by the same operation as that described above. In this example, the same inquiry has not been made previously.
Consequently, in the step SA3 the server-side DNS server 5 consults the sorting table (not shown in FIG. 18) and converts the representative domain name for which notification has been received to the IP address of the next server which is the second server 7. The server-side DNS server 5 sends notification of the IP address of the server 7 via the LAN/WAN 4 and the LAN/WAN 1 to the client-side DNS server 3. In the subsequent step SA4, the client-side DNS server 3 notifies the client (not shown in FIG. 18) of the IP address of the server 7 via the LAN/WAN 1.
In the step SA5, the client (not shown in FIG. 18) which has received the above notification transmits an IP packet including the IP address of the server 7 via the LAN/WAN 1 and the LAN/WAN 4 to the server 7. The IP packet reaches the server 7 after being routed by a router which is not shown in FIG. 18. As a result, a connection is established between the client (not shown) and the server 7, and the server 7 supplies the service requested by the client (not shown).
Thereafter, the server-side DNS server 5 balances the load by consulting the sorting table each time an inquiry for an IP address is received and sorting the accesses from the clients as follows: server 6xe2x86x92server 7xe2x86x92server 6xe2x86x92server 7.
Subsequently, the operation will be explained in a case where the system of the server 6 becomes inoperative and the connection to the server 7 is cut-off following a disaster as shown in FIG. 19. FIG. 19 shows the state when a disaster has made the server 6 inoperative and cut-off the connection to the server 7, with the result that the servers 6 and 7 cannot be accessed from the outside. In this example, the servers 6 and 7 are not deleted from the sorting table in the server-side DNS server 5.
In a step SB1, the client 2 notifies the client-side DNS server 3 via the LAN/WAN 1 of the representative domain name corresponding to the IP address for which the client-side DNS server 3 has sent the inquiry.
The client-side DNS server 3 determines whether the same inquiry has previously been received by accessing its own cash memory (not shown in FIG. 18) and consulting the inquiry history data. Assuming that the inquiry history data prior to the disaster is still stored in the cash memory, in a step SB4 the client-side DNS server 3 notifies the client 2 via the LAN/WAN 1 of the IP address of for example the server 6 which is contained in the inquiry history data.
In the step SB5, the client 2 attempts to access the server 6 but is unable to do so since the system of the server 6 is inoperative. However, since the inquiry history data prior to the disaster remains unaffected, the client 2 is notified of the IP address of the server 6 even though it cannot actually be accessed.
On the other hand, when the same inquiry has not previously been received, in a step SB2 the client-side DNS server 3 sends a representative domain name to the server-side DNS server 5 via the LAN/WAN 1 and the LAN/WAN 4. Consequently, in a step SB3 the server-side DNS server 5 consults a sorting table (not shown in the diagram) in which the server 6 is deemed a first server and the server 7 is deemed a second server, and converts the representative domain name for which notification has been received to, for example, the IP address of the first server 6. It should be noted that the sorting table has been prepared prior to the disaster and does not reflect the present state of the server 6 (i.e. the fact that the server 6 cannot be accessed).
In the step SB3, the server-side DNS server 5 sends the IP address of the server 6 to the client-side DNS server 3 via the LAN/WAN 4 and the LAN/WAN 1. In the step SB4, the client-side DNS server 3 stores the IP address of the server 6 as the above-mentioned inquiry history data in its cash memory (not shown in FIG. 19) and notifies the client 2 via the LAN/WAN 1. Then, in the step SB5, the client 2 attempts to access the server 6 but is unable to do so since the server 6 is inoperative.
When another client which is not shown in FIG. 19 notifies the client-side DNS server 3 of the representative domain name via the LAN/WAN 1 (Step SB1), in the step SB2 the client-side DNS server 3 sends an inquiry for the IP address of a virtual server via the LAN/WAN 1 and the LAN/WAN 4 to the server-side DNS server 5 by the same operation as that described above. In this example, the same inquiry has not been made previously.
In the step SB3, the server-side DNS server 5 consults the sorting table (not shown in FIG. 19) and converts the received representative domain name to the IP address of the subsequent second server, which is the server 7. It should be noted here that the sorting table was prepared prior to the disaster and consequently does not reflect the present state of the server 7 (i.e. the fact that the server 7 cannot be accessed).
The server-side DNS server 5 sends notification of the IP address of the server 7 via the LAN/WAN 4 and the LAN/WAN 1 to the client-side DNS server 3. In the subsequent step SB4, the client-side DNS server 3 notifies the client (not shown in FIG. 19) of the IP address of the server 7 via the LAN/WAN 1. In the step SB5, the client (not shown in FIG. 19) which has received the above notification attempts to access the server 7, but cannot do so since the connection line to the server 7 has been severed.
FIG. 20 is a diagram showing a second example of a constitution of a conventional network system. In the network system shown in FIG. 20, an NAT (Network Address Translator) method for converting a destination address of an IP header to an IP address of a server at the sorting destination, and an MAC (Media Access Control) method for substituting the destination address with an MAC address of the sorting destination server and the like, are used as the load balancing method.
In FIG. 20, an LAN/WAN 10 is a large-scale network for carrying out data communication between multiple physically separate computers by means of internet working, and for example comprises the internet. The client 11 is provided on a client (user) side and connects to the LAN/WAN 10.
The client 11 comprises a computer end terminal for requesting service from a server 13 (and a server 14) explained later via the LAN/WAN 10. A load balancing apparatus 12 balances the load between the servers 13 and 14 by sorting access requests from the client 11 to either one of the servers 13 and 14 by means of NAT and MAC as described above. A representative IP address represents the servers 13 and 14 and is appended to the load balancing apparatus 12.
The servers 13 and 14 are provided on the service supplier side and connect to the LAN/WAN 10. The servers 13 and 14 comprise computer terminals for supplying service to the client 11 in accordance with service requests therefrom. By using the above-mentioned representative IP address, the servers 13 and 14 function as a single server from the point of view of the client 11. An IP address is appended to each of the servers 13 and 14. That is, the servers 13 and 14 form one virtual server which is expressed by the representative IP address, and the client 11 accesses the representative IP address of this virtual server.
To access the virtual server in the above constitution, for example in a step SC1 the client 11 accesses the load balancing apparatus 12 having the representative IP address via the LAN/WAN 10. In a step SC2, the client 12 sorts an IP packet (service request) from the client 11 and allocates it to the server 14, for example, by means of NAT and MAC.
In a subsequent step SC3, a connection via the LAN/WAN 10 and the load balancing apparatus 12 is established between the client 11 and the server 14, and the server 14 supplies the service requested by the client 11. In certain cases, the connection route between the client 11 and the server 14 does not pass via the load balancing apparatus 12 but only via the LAN/WAN 10 as a step SC4.
Subsequently, the operation will be explained in a case where a disaster has made the load balancing apparatus 12 inoperative and cut-off the connection to the LAN/WAN 10, as shown in FIG. 21. It is assumed that the disaster has not affected the servers 13 and 14.
In such a state, in a step SD1 the client 11 attempts to access the load balancing apparatus 12 having the representative IP address but is unable to do so since the load balancing apparatus 12 is inoperative and the connection line to the LAN/WAN 10 is cut-off, even though the servers 13 and 14 are functioning normally.
As described above, in the conventional network system the load is efficiently balanced by the client-side DNS server 3 and the server-side DNS server 5 shown in FIG. 18, and by the load balancing apparatus 12 shown in FIG. 20.
However, the conventional network system is extremely vulnerable to disaster as described in FIGS. 19 and 21. For example, when one load balancing apparatus 12 has become inoperative due to a disaster, the entire system stops.
Accordingly, each apparatus may be configured complexly to prevent the service from stopping in the event of a disaster. However, when a disaster such as an earthquake occurs in a region in which multiple apparatuses having complex constitutions are provided, there is a high possibility that all the multiple apparatuses will be damaged. For this reason, the above-mentioned method offers no basic solution.
It is an object of the present invention to obtain a load balancing system which is capable of preventing the service from stopping due to a disaster.
In order to achieve the above objects, a first aspect of this invention provides a load balancing system applied in a network system comprising a plurality of clients (corresponding to the clients 100 and 200 in the embodiment described later), and a plurality of servers (corresponding to the servers 510, 520, 610 and 620 in the embodiment described later) which are separately provided in a plurality of sites (corresponding to the service sites SS1 and SS2 in the embodiment described later) and supply services to the plurality of clients, the load balancing system balancing service requests from the plurality of clients, and comprising a plurality of first load balancing units (corresponding to first load balancing apparatuses 410, 420 and 430 in the embodiment described later) which are provided physically separate and balance load by first-sorting service requests from the plurality of clients to the plurality of sites; and a plurality of second load balancing units (corresponding to a second load balancing apparatus 500 and a second load balancing apparatus 600 in the embodiment described later) which are provided in correspondence with the plurality of sites and each carry out load balancing by second-sorting a service request which has been first-sorted by the first load balancing unit to one of a plurality of servers provided in the site; one of the plurality of first load balancing units being set as a primary, the primary first load balancing unit monitoring the operating status of the other first load balancing units and the plurality of second load balancing units, and removing a unit which has stopped operating from the units which carry out load balancing.
According to the invention of the first aspect, when a client makes a request for service, one of the plurality of first load balancing units first-sorts the service request to one site (a second load balancing unit). Consequently, the second load balancing unit second-sorts the service request to one server.
In the case where one of multiple first load balancing units has stopped operating as a result of a disaster, this first load balancing unit is excluded from the units which balance the load by first-sorting. Therefore, in this case, the excluded first load balancing unit does not carry out first-sorting even when a client sends a service request. Instead, the service request is first-sorted by the other first load balancing unit which is operating normally.
Further, in the case where one of the plurality of second load balancing units has stopped operating due to a disaster, this second load balancing unit is excluded from the units which carry out load balancing by second-sorting. Therefore, in this case, the first-sorted service request is not second-sorted by the excluded second load balancing unit, but is instead second-sorted by the other second load balancing unit which is operating normally.
Thus, according to the first aspect of the invention, the primary first load balancing unit is set, and this first load balancing unit monitors the operating statuses of the other first load balancing unit and the plurality of second load balancing units. When one of the units stops operating, it is excluded from the units which perform load balancing. Therefore, it is possible to prevent the service from stopping due to a disaster.
Further, the invention according to a second aspect comprises the load balancing system as described in the first aspect, wherein one of the first load balancing units other than the primary first load balancing unit is set as a secondary; the operating statuses of the plurality of first load balancing units and the plurality of second load balancing units are mutually monitored, and in the case where the primary first load balancing unit has stopped operating according to the result of the mutual monitoring, the secondary first load balancing unit functions as a primary first load balancing unit.
According to the invention of the second aspect, when the result of mutually monitoring the operating status indicates that the primary first load balancing unit has stopped operating, the secondary first load balancing unit immediately functions as a primary first load balancing unit.
In this way, according to the invention of the second aspect, since the secondary first load balancing unit is set beforehand, when the primary first load balancing unit stops operating, the secondary first load balancing unit can immediately function as a primary first load balancing unit. Therefore, the fatal problem of there being no primary can be avoided.
Further, the invention according to a third aspect comprises the load balancing system as described in the second aspect, wherein in the case where the primary first load balancing unit which stopped operating has recommenced operation according to the result of the mutual monitoring, the primary first load balancing unit at that point functions as a secondary and the first load balancing unit which has recommenced operation functions as a primary.
According to the invention of the third aspect, when the primary first load balancing unit which stopped operating has starting operating again, the primary at that point is automatically switched to the original primary. In this way, according to the invention of the third aspect, the operating status of the first load balancing unit which has stopped operating is mutually monitored, thereby making it possible to immediately switch the primary to the original primary at the point where the first load balancing unit recovered.
Further, the invention according to a fourth aspect comprises the load balancing system as described in any one of the first to third aspects, wherein the plurality of first load balancing units and the plurality of second load balancing units are physically dispersed across a wide region.
According to the invention of the fourth aspect, the plurality of first load balancing units and the plurality of second load balancing units are physically dispersed across a wide region. Therefore, damage can be kept to a minimum even when a disaster (such as an earthquake) occurs locally. As a consequence, service stoppage caused by damage due to the disaster can be more effectively avoided.
Further, the invention according to a fifth aspect comprises the load balancing system as described in any one of the first to fourth aspects, wherein the primary first load balancing unit creates and updates a sorting table for considering and first-sorting the load in the plurality of servers, distributes the sorting table to the other first load balancing units when creating and updating the sorting table, and carries out first-sorting based on the sorting table.
According to the invention of the fifth aspect, the sorting table which is created and updated by the primary first load balancing unit is distributed to the other first load balancing units. Therefore, problems arising from update misses can be prevented, since all the load balancing units carry out first-sorting based on the same reference.
Further, the invention according to a sixth aspect comprises the load balancing system as described in the fifth aspect, wherein the primary first load balancing unit creates and updates the sorting table based on measurements taken by the plurality of second load balancing units of the load in the plurality of servers.
According to the invention of the sixth aspect, first-sorting is carried out based on a sorting table which reflects the results of measurements of the actual load in the server. Therefore, the load can be balanced in accordance with the actual load.
Further, the invention according to a seventh aspect comprises the load balancing system as described in the sixth aspect, wherein the primary first load balancing unit creates and updates the sorting table based on measurements taken by the plurality of second load balancing units of the path load in the communications path to the plurality of clients.
According to the invention of the seventh aspect, first-sorting is carried out based on a sorting table which reflects the path load. Therefore, the load balancing can be carried out as appropriate to the status of the communications path.